#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<stdio.h>
#include<string>
#include<iomanip>
using namespace std;
int main()
{
	int begin;
	int end;
	scanf("%d", &begin);
	scanf("%d", &end);
	if (end < begin)
		return 0;
	int sum = 0;
	for (int i = begin; i <= end; i++)
	{
		cout << setw(5) << setiosflags(ios::right) << i;
		if ((i != begin) && ((i - begin + 1) % 5 == 0) && (i != end))
			printf("\n");
		sum = sum + i;
	}
	printf("\nSum = %d", sum);
	system("PAUSE");
	return 0;
}